package ui;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JRadioButton;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.ListModel;
import javax.swing.SpinnerListModel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class FrameCriaSala extends javax.swing.JFrame {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private JLabel labelCabecalho;
	private JSpinner spinnerCapacidade;
	private JRadioButton radioButtonAberto;
	private AbstractAction AcaoCancelar;
	private AbstractAction AcaoConcluir;
	private JLabel labelFinalidade;
	private JComboBox comboBoxFinalidade;
	private JLabel labelCapacidade;
	private JButton buttonCancela;
	private JButton buttonConcluir;
	private JLabel labelTipo;
	private JComboBox comboBoxTipo;
	private JTextField textFieldID;
	private JTextField textFieldNome;
	private JTextField textFieldApelido;
	private JLabel labelID;
	private JLabel labelApelido;
	private JLabel labelNome;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				FrameCriaSala inst = new FrameCriaSala();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public FrameCriaSala() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			getContentPane().setLayout(null);
			setResizable(false);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				labelCabecalho = new JLabel();
				getContentPane().add(labelCabecalho);
				labelCabecalho.setText("Nova Sala");
				labelCabecalho.setBounds(98, 11, 126, 33);
				labelCabecalho.setFont(new java.awt.Font("Dialog",1,26));
			}
			{
				labelNome = new JLabel();
				getContentPane().add(labelNome);
				labelNome.setText("Nome:");
				labelNome.setBounds(12, 85, 36, 16);
			}
			{
				labelApelido = new JLabel();
				getContentPane().add(labelApelido);
				labelApelido.setText("Apelido:");
				labelApelido.setBounds(12, 112, 45, 16);
			}
			{
				labelID = new JLabel();
				getContentPane().add(labelID);
				labelID.setText("ID:");
				labelID.setBounds(12, 61, 22, 16);
			}
			{
				textFieldApelido = new JTextField();
				getContentPane().add(textFieldApelido);
				textFieldApelido.setBounds(69, 110, 147, 20);
			}
			{
				textFieldNome = new JTextField();
				getContentPane().add(textFieldNome);
				textFieldNome.setBounds(69, 83, 147, 20);
			}
			{
				textFieldID = new JTextField();
				getContentPane().add(textFieldID);
				textFieldID.setBounds(69, 59, 48, 20);
			}
			{
				SpinnerListModel spinnerCapacidadeModel = 
					new SpinnerListModel(
							new String[] { "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",  "9",  "10",  "11",  "12",  "13",  "14",  "15",  "16",  "17",  "18",  "19",  "20",  "21",  "22",  "23",  "24",  "25",  "26",  "27",  "28",  "29",  "30",  "31",  "32",  "33",  "34",  "35",  "36",  "37",  "38",  "39",  "40",  "41",  "42",  "43",  "44",  "45",  "46",  "47",  "48",  "49"});
				spinnerCapacidade = new JSpinner();
				getContentPane().add(spinnerCapacidade);
				spinnerCapacidade.setModel(spinnerCapacidadeModel);
				spinnerCapacidade.setBounds(76, 142, 43, 20);
			}
			{
				labelCapacidade = new JLabel();
				getContentPane().add(labelCapacidade);
				labelCapacidade.setText("Capacidade:");
				labelCapacidade.setBounds(10, 145, 62, 14);
			}
			{
				ComboBoxModel comboBoxTipoModel = 
					new DefaultComboBoxModel(
							new String[] {  "ESCRITORIO", "LABORATORIO_QUIMICA", "ETC..." });
				comboBoxTipo = new JComboBox();
				getContentPane().add(comboBoxTipo);
				comboBoxTipo.setModel(comboBoxTipoModel);
				comboBoxTipo.setBounds(205, 142, 104, 20);
			}
			{
				labelTipo = new JLabel();
				getContentPane().add(labelTipo);
				labelTipo.setText("Tipo:");
				labelTipo.setBounds(171, 145, 24, 14);
			}
			{
				buttonConcluir = new JButton();
				getContentPane().add(buttonConcluir);
				buttonConcluir.setText("Criar");
				buttonConcluir.setBounds(90, 200, 75, 23);
				buttonConcluir.setAction(getAcaoConcluir());
			}
			{
				buttonCancela = new JButton();
				getContentPane().add(buttonCancela);
				buttonCancela.setText("Cancelar");
				buttonCancela.setBounds(171, 200, 75, 23);
				buttonCancela.setAction(getAcaoCancelar());
			}
			{
				ComboBoxModel comboBoxFinalidadeModel = 
					new DefaultComboBoxModel(
							new String[] { "Item One", "Item Two" });
				comboBoxFinalidade = new JComboBox();
				getContentPane().add(comboBoxFinalidade);
				comboBoxFinalidade.setModel(comboBoxFinalidadeModel);
				comboBoxFinalidade.setBounds(72, 169, 104, 20);
			}
			{
				labelFinalidade = new JLabel();
				getContentPane().add(labelFinalidade);
				getContentPane().add(getRadioButtonAberto());
				labelFinalidade.setText("Finalidade:");
				labelFinalidade.setBounds(10, 172, 52, 14);
			}
			pack();
			this.setSize(325, 272);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	private AbstractAction getAcaoConcluir() {
		if(AcaoConcluir == null) {
			AcaoConcluir = new AbstractAction("Criar", null) {
				public void actionPerformed(ActionEvent evt) {
					System.out.println("Criado.");
				}
			};
		}
		return AcaoConcluir;
	}
	
	private AbstractAction getAcaoCancelar() {
		if(AcaoCancelar == null) {
			AcaoCancelar = new AbstractAction("Cancelar", null) {
				public void actionPerformed(ActionEvent evt) {
					System.out.println("Cancelou");
				}
			};
		}
		return AcaoCancelar;
	}
	
	private JRadioButton getRadioButtonAberto() {
		if(radioButtonAberto == null) {
			radioButtonAberto = new JRadioButton();
			radioButtonAberto.setText("Aberto");
			radioButtonAberto.setBounds(202, 168, 59, 23);
			radioButtonAberto.setEnabled(false);
		}
		return radioButtonAberto;
	}

}
